﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Solidi
{
	public static class DependencyRegistryExtensions
	{
		public static IEnumerable<IDependency> Find<TType>(this IDependencyRegistry source)
		{
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

			return source.Find(new DependencyKey(typeof(TType)));
		}

        public static IEnumerable<IDependency> Find(this IDependencyRegistry source, IDependencyKey key)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            return source.Find(key, null);
        }
	}
}
